package com.lipaluma.field.mapper;

import java.lang.reflect.Field;

import com.lipaluma.field.mapper.mapping.FieldMappingInfo;
import com.lipaluma.parser.marshalling.ObjectMarshalled;

/**
 * A MapColumn must implements this interface to describe the algorithm who will format the value of the field before writing this in the output file.
 * @author mario.soares
 */
public interface MarshalFieldMapper {
	
	/**
	 * Write the value extracted of the object to the row
	 * @param value value to write
	 * @param row final row
	 */
	void marshalValue(Object value, ObjectMarshalled marshal);

	/**
	 * describe the FieldMapper by giving information of the FieldMapper like column index, column name, the name of the field, ...<br/>
	 * The description for example used when an error is detected during the process to give the maximum of informations to locate the error.
	 * 
	 * @return the column description
	 */
	String getDescription();
	
	/**
	 * return the field associated to the FieldMapper
	 * @return field the field associated to the FieldMapper
	 */
	Field getField();
	
	FieldMappingInfo[] getMappings();
}
